﻿-- =============================================
-- Author:		Andreas Könighofer (IT-eXperience)
-- Create date: 15.01.2009
-- Description:	Deletes all locations that match with the given parameters
-- =============================================
CREATE PROCEDURE [dbo].[DeleteLocation] 
	-- Add the parameters for the stored procedure here
	@LocationID SMALLINT = NULL
	, @LocationName NVARCHAR(50) = NULL
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	DELETE FROM Location
	WHERE ((@LocationID IS NULL) OR (LocationID = @LocationID))
	AND ((@LocationName IS NULL) OR (LocationName = @LocationName))
END

---- end script DeleteLocation stored procedure ----

---- start script DeleteMachineType stored procedure ----

